import * as types from '../../mutation-types/manager/index';

const state = {
    managerIndex: '',
    managerGoogleIndex: '',
    showPopover: false,
    showTipPopover: false,
    managerEffectiveInfo: {
        "isPayInfo": false,
        "reach": "0",
        "balance": 0.00,
        "impressions": "0",
        "actions": "0",
        "effective": "0",
        "webClick": "0",
        "spend": 0.00
    },

    managerGoogleEffectiveInfo: {
        "impressions": "0",
        "actions": "0",
        "clicks": "0",
        "reach": "0",
        "cpc": 0,
        "effective": "0",
        "websiteClickCtr": '0',
        "spend": 0.00
    },
    budgetData: {},
    budgetDataGoogle: {},
    popoverData: {},
    popoverAdditionData: {},
    tipPopoverData: {},
    exportStatus: false,
    reloadStatus: false,
    countryList: [],
    enableExport: false
};

const mutations = {
    [types.ENABLE_EXPORT](state, {enableExport}) {
        state.enableExport = enableExport;
    },
    [types.COUNTRY_LIST](state, {countryList}) {
        state.countryList = countryList;
    },
    [types.MANAGER_INDEX](state, {managerIndex}) {
        state.managerIndex = managerIndex;
    },
    [types.MANAGER_GOOGLE_INDEX](state, {managerGoogleIndex}) {
        state.managerGoogleIndex = managerGoogleIndex;
    },
    [types.SHOW_POPOVER](state, {showPopover}) {
        state.showPopover = showPopover;
    },
    [types.SHOW_TIP_POPOVER](state, {showTipPopover}) {
        state.showTipPopover = showTipPopover;
    },
    [types.BUDGET_DATA](state, {budgetData}) {
        state.budgetData = budgetData;
    },
    [types.BUDGET_DATA_GOOGLE](state, {budgetDataGoogle}) {
        state.budgetDataGoogle = budgetDataGoogle;
    },
    [types.POPOVER_DATA](state, {popoverData}) {
        state.popoverData = popoverData;
    },
    [types.POPOVER_ADDITION_DATA](state, {popoverAdditionData}) {
        state.popoverAdditionData = popoverAdditionData;
    },
    [types.TIP_POPOVER_DATA](state, {tipPopoverData}) {
        state.tipPopoverData = tipPopoverData;
    },
    [types.EXPORT_STATUS](state, {exportStatus}) {
        state.exportStatus = exportStatus;
    },
    [types.MANAGE_EFFECTIVE_INFO](state, {managerEffectiveInfo}) {
        state.managerEffectiveInfo = managerEffectiveInfo || {};
    },
    [types.RELOAD_STATUS](state, {reloadStatus}) {
        state.reloadStatus = reloadStatus || false;
    },
    [types.MANAGE_EFFEGOOGLR_CTIVE_INFO](state, {managerGoogleEffectiveInfo}) {
        state.managerGoogleEffectiveInfo = managerGoogleEffectiveInfo || {};
    },

};

export default {
    state,
    mutations
};